home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / perl5 / Debian / DictionariesCommon.pm < prev   
Encoding:
Perl POD Document  |  2011-01-12  |  18.9 KB  |  618 lines

  1. #!/usr/bin/perl
  2.  
  3. package Debian::DictionariesCommon;
  4.  
  5. use base qw(Exporter);
  6. use Text::Iconv;
  7.  
  8. # List all exported symbols here.
  9. our @EXPORT_OK = qw(parseinfo updatedb loaddb
  10.             dico_checkroot
  11.             dico_get_spellchecker_params
  12.             getlibdir
  13.                     dico_getsysdefault dico_setsysdefault
  14.             getuserdefault setuserdefault
  15.             build_emacsen_support
  16.             build_jed_support
  17.             build_squirrelmail_support
  18.             );
  19. # Import :all to get everything.
  20. our %EXPORT_TAGS = (all => [@EXPORT_OK]);
  21.  
  22. my $infodir             = "/var/lib/dictionaries-common";
  23. my $cachedir            = "/var/cache/dictionaries-common";
  24. my $etcdir              = "/etc/dictionaries-common";
  25. my $ispelldefault       = "ispell-default";
  26. my $userdefault         = ( defined $ENV{HOME} ) ? "$ENV{HOME}/.$ispelldefault" : undef;
  27. my $emacsensupport      = "emacsen-ispell-dicts.el";
  28. my $jedsupport          = "jed-ispell-dicts.sl";
  29. my $squirrelmailsupport = "sqspell.php";
  30. my %sysetcdefault       = ("ispell"   => "$etcdir/ispell-default",
  31.                "wordlist" => "$etcdir/wordlist-default");
  32.  
  33. sub dico_checkroot {
  34.   return if ($> == 0 or ($^O eq 'interix' and $> == 197108));
  35.   die "$0: You must run this as root.\n";
  36. }
  37.  
  38. sub getlibdir {
  39.   my $class = shift;
  40.   return "$infodir/$class";
  41. }
  42.  
  43. sub mydie {
  44.   my $routine = shift;
  45.   my $errmsg = shift;
  46.   die __PACKAGE__, "($routine):E: $errmsg";
  47. }
  48.  
  49. sub parseinfo {
  50.   my $file = shift;
  51.   local $/ = "";    # IRS is global, we need 'local' here, not 'my'
  52.   open (DICT, "< $file");
  53.   my %dictionaries =
  54.     map {
  55.       s/^([^:]+):/lc ($1) . ":"/meg;  # Lower case field names
  56.       my %hash = /^([^:]+):\s*((?<!\n)[^\n]+)\s*$/mg;
  57.       map { delete $hash{$_} if ($hash{$_} =~ /^\s+$/) } keys %hash;
  58.       mydie ('parseinfo',
  59.          qq{Record in file $file does not have a "Language" entry})
  60.     if not exists $hash{language};
  61.       mydie ('parseinfo',
  62.          qq{Record in file $file does not have a "Hash-Name" entry})
  63.     if not exists $hash{"hash-name"};
  64.       my $lang = delete $hash{language};
  65.       ($lang, \%hash);
  66.     } <DICT>;
  67.   return \%dictionaries;
  68. }
  69.  
  70. # ------------------------------------------------------------------
  71. sub dico_dumpdb {
  72. # ------------------------------------------------------------------
  73. # Save %dictionaries in Data::Dumper like format. This function
  74. # should be enough for the limited needs of dictionaries-common
  75. # ------------------------------------------------------------------
  76.   my $class        = shift;
  77.   my $dictionaries = shift;
  78.   my @fullarray    = ();
  79.   my @dictarray    = ();
  80.   my $output       = "$cachedir/$class.db";
  81.   my $dictentries  = '';
  82.   my $thevalue     = '';
  83.  
  84.   foreach $thedict ( sort keys %{$dictionaries}){
  85.     $dictentries = $dictionaries->{$thedict};
  86.     @dictarray   = ();
  87.     foreach $thekey ( sort keys %{$dictentries}){
  88.       $thevalue = $dictentries->{$thekey};
  89.       # Make sure \ and ' are escaped in keyvals
  90.       $thevalue =~ s/(\\|\')/\\$1/g;
  91.       push (@dictarray,"     \'$thekey\' => \'$thevalue\'");
  92.     }
  93.     # Make sure \ and ' are escaped in dict names
  94.     $thedict =~ s/(\\|\')/\\$1/g;
  95.     push (@fullarray,
  96.       "  \'$thedict\' => \{\n" . join(",\n",@dictarray) . "\n  \}");
  97.   }
  98.  
  99.   mkdir $cachedir unless (-d $cachedir);
  100.  
  101.   open (DB,"> $output");
  102.   print DB generate_comment("### ") . "\n";
  103.   print DB "%dictionaries = (\n";
  104.   print DB join (",\n",@fullarray);
  105.   print DB "\n);\n\n1;\n";
  106.   close DB;
  107. }
  108.  
  109. # ------------------------------------------------------------------
  110. sub dico_get_spellchecker_params {
  111. # ------------------------------------------------------------------
  112. # dico_get_spellchecker_params($class,\%language)
  113. #  Get right params for $class (currently unused) and $language
  114. # ------------------------------------------------------------------
  115.   my $class       = shift;
  116.   my $language    = shift;
  117.   my $d_option    = "";
  118.   my $w_option    = "";
  119.   my $T_option    = "";
  120.   my $ispell_args = "";
  121.  
  122.   $d_option = "-d $language->{'hash-name'}"
  123.       if exists $language->{'hash-name'};
  124.   $w_option = "-w $language->{'additionalchars'}"
  125.       if exists $language->{'additionalchars'};
  126.  
  127.   if ( exists $language->{'extended-character-mode'} ){
  128.     $T_option =  $language->{'extended-character-mode'};
  129.     $T_option =~ s/^~//; # Strip leading ~ from Extended-Character-Mode.
  130.     $T_option =  '-T ' . $T_option;
  131.   }
  132.  
  133.   if ( exists $language->{'ispell-args'} ){
  134.     $ispell_args = $language->{'ispell-args'};
  135.     foreach ( split('\s+',$ispell_args) ) {
  136.       # No d_option if already in $ispell_args
  137.       $d_option = "" if /^\-d/;
  138.     }
  139.   }
  140.   return "$d_option $w_option $T_option $ispell_args";
  141. }
  142.  
  143. # ------------------------------------------------------------------
  144. sub updatedb {
  145. # ------------------------------------------------------------------
  146. # Parse info files for the given class and update class database
  147. # ------------------------------------------------------------------
  148.   my $class        = shift;
  149.   my %dictionaries = ();
  150.  
  151.   foreach my $file (<$infodir/$class/*>) {
  152.     next if $file =~ m/.*~$/;                 # Ignore ~ backup files
  153.     my $dicts = &parseinfo ("$file");
  154.     %dictionaries = (%dictionaries, %$dicts);
  155.   }
  156.   &dico_dumpdb($class,\%dictionaries);
  157. }
  158.  
  159. # ------------------------------------------------------------------
  160. sub loaddb {
  161. # ------------------------------------------------------------------
  162. # Load class database
  163. # ------------------------------------------------------------------
  164.   my $class  = shift;
  165.   my $dbfile = "$cachedir/$class.db";
  166.   if (-e $dbfile) {
  167.     do $dbfile;
  168.   }
  169.   return \%dictionaries;
  170. }
  171.  
  172. # ------------------------------------------------------------------
  173. sub getdefault {
  174. # ------------------------------------------------------------------
  175. # If available, read current user's default from given file.
  176. # ------------------------------------------------------------------
  177.   $file = shift;
  178.   if (-f $file) {
  179.     my $lang = `cat $file`;
  180.     chomp $lang;
  181.     return $lang;
  182.   }
  183.   else {
  184.     return undef;
  185.   }
  186. }
  187.  
  188. # ------------------------------------------------------------------
  189. sub getuserdefault {
  190. # ------------------------------------------------------------------
  191. # Get user default from user's default file
  192. # ------------------------------------------------------------------
  193.   die "Dictionaries-common::getuserdefault: Could not set \$userdefault. Aborting ...\n"
  194.     unless $userdefault;
  195.   getdefault ($userdefault);
  196. }
  197.  
  198. # ------------------------------------------------------------------
  199. sub dico_getsysdefault {
  200. # ------------------------------------------------------------------
  201. # Get system default value for given class
  202. # ------------------------------------------------------------------
  203.   my $class = shift;
  204.   getdefault ($sysetcdefault{$class});
  205. }
  206.  
  207. # ------------------------------------------------------------------
  208. sub dico_setsysdefault {
  209. # ------------------------------------------------------------------
  210. # Set system default value for given class
  211. # ------------------------------------------------------------------
  212.   my $class = shift;
  213.   my $value = shift;
  214.  
  215.   open (DEFAULT, "> $sysetcdefault{$class}");
  216.   print DEFAULT $value;
  217.   close DEFAULT;
  218. }
  219.  
  220. # ------------------------------------------------------------------
  221. sub setuserdefault {
  222. # ------------------------------------------------------------------
  223. # Write user's default value to user's default file
  224. # ------------------------------------------------------------------
  225.   my $default      = getuserdefault ();
  226.   my $dictionaries = loaddb ("ispell");
  227.   my @choices      = sort keys %$dictionaries;
  228.  
  229.   if (scalar @choices == 0) {
  230.     warn "Sorry, no ispell dictionary is installed in your system.\n";
  231.     return;
  232.   }
  233.  
  234.   my $initial = -1;
  235.   if (defined $default) {
  236.     for (my $i = 0; $i < scalar @choices; $i++) {
  237.       if ($default eq $choices[$i]) {
  238.     $initial = $i;
  239.     last;
  240.       }
  241.     }
  242.   }
  243.  
  244.   open (TTY, "/dev/tty");
  245.   while (1) {
  246.     $| = 1;
  247.     print
  248.       "\nSelect your personal ispell dictionary for use with ispell-wrapper\n\n";
  249.     for ($i = 0; $i < scalar @choices; $i++) {
  250.       print "  " . ($i == $initial ? "*" : " ")
  251.          . " [" . ($i+1) . "] $choices[$i]\n";
  252.     }
  253.     print qq(\nSelect number or "q" for quit)
  254.       . ($initial != -1 ? " (* is the current default): " : ": ");
  255.     my $sel = <TTY>;
  256.     chomp $sel;
  257.     last if $sel eq "q";
  258.     if ($sel < 1 or $sel > scalar @choices) {
  259.       print qq{\nInvalid choice "$sel".\n\n};
  260.       next;
  261.     }
  262.     else {
  263.       $sel--;
  264.       open (DEFAULT, "> $userdefault");
  265.       print DEFAULT $choices[$sel];
  266.       close DEFAULT;
  267.       last;
  268.     }
  269.   }
  270.   close TTY;
  271. }
  272.  
  273. sub generate_comment {
  274.   my $commstr = shift;
  275.   my $comment = "This file is part of the dictionaries-common package.
  276. It has been automatically generated.
  277. DO NOT EDIT!";
  278.   $comment =~ s{^}{$commstr}mg;
  279.   return "$comment\n";
  280. }
  281.  
  282. # ------------------------------------------------------------------
  283. sub build_emacsen_support {
  284. # ------------------------------------------------------------------
  285. # Put info from dicts info files into emacsen-ispell-dicts.el
  286. # ------------------------------------------------------------------
  287.   my $elisp          = '';
  288.   my @classes        = ("aspell","hunspell","ispell");
  289.   my %entries        = ();
  290.   my %class_locales  = ();
  291.  
  292.   foreach $class ( @classes ){
  293.     my $dictionaries = loaddb ($class);
  294.  
  295.     foreach $k (keys %$dictionaries) {
  296.       my $lang = $dictionaries->{$k};
  297.  
  298.       next if (exists $lang->{'emacs-display'}
  299.            && $lang->{'emacs-display'} eq "no");
  300.  
  301.       my $hashname = $lang->{"hash-name"};
  302.       my $casechars = exists $lang->{casechars} ?
  303.       $lang->{casechars} : "[a-zA-Z]";
  304.       my $notcasechars = exists $lang->{"not-casechars"} ?
  305.       $lang->{"not-casechars"} : "[^a-zA-Z]";
  306.       my $otherchars = exists $lang->{otherchars} ?
  307.       $lang->{otherchars} : "[']";
  308.       my $manyothercharsp = exists $lang->{"many-otherchars"} ?
  309.       ($lang->{"many-otherchars"} eq "yes" ? "t" : "nil") : "nil";
  310.       my $ispellargs = exists $lang->{"ispell-args"} ?
  311.       $lang->{"ispell-args"} : "-d $hashname";
  312.       my $extendedcharactermode = exists $lang->{"extended-character-mode"} ?
  313.       ('"' . $lang->{"extended-character-mode"} . '"') : "nil";
  314.       my $codingsystem = exists $lang->{"coding-system"} ?
  315.       $lang->{"coding-system"} : "nil";
  316.       my $emacsenname = exists $lang->{"emacsen-name"} ?
  317.       $lang->{"emacsen-name"} : $hashname;
  318.  
  319.       # Explicitly add " -d $hashname" to $ispellargs if not already there.
  320.       # Note that this must check for "-dxx", "-d xx", "-C -d xx", "-C -dxx" like matches
  321.       if ( $ispellargs !~ m/( |^)-d/ ){
  322.     print STDERR " - $class-emacsen: Adding \" -d $hashname\" to \"$ispellargs\"\n"
  323.       if defined $ENV{'DICT_COMMON_DEBUG'};
  324.     $ispellargs .= " -d $hashname";
  325.       }
  326.  
  327.       $entries{$class}{$emacsenname} = $entries{'all'}{$emacsenname} =
  328.       ['"' . $emacsenname  . '"',
  329.        '"' . $casechars    . '"',
  330.        '"' . $notcasechars . '"',
  331.        '"' . $otherchars   . '"',
  332.        $manyothercharsp,
  333.        '("' . join ('" "', split (/\s+/,$ispellargs)) . '")',
  334.        $extendedcharactermode,
  335.        $codingsystem];
  336.  
  337.       if ( $class eq "aspell" && exists $lang->{"aspell-locales"} ){
  338.     foreach ( split(/\s*,\s*/,$lang->{"aspell-locales"}) ){
  339.       $class_locales{"aspell"}{$_} = $emacsenname;
  340.     }
  341.       } elsif ( $class eq "hunspell" && exists $lang->{"hunspell-locales"} ){
  342.     foreach ( split(/\s*,\s*/,$lang->{"hunspell-locales"}) ){
  343.       $class_locales{"hunspell"}{$_} = $emacsenname;
  344.     }
  345.       }
  346.     }
  347.   }
  348.  
  349.   # Write alists of ispell, hunspell and aspell only installed dicts and their properties
  350.  
  351.   foreach $class ( @classes ) {
  352.     my @class_dicts = reverse sort keys %{ $entries{$class} };
  353.     if ( scalar @class_dicts ){
  354.       $elisp .= "\n;; Adding $class dicts\n\n";
  355.       foreach ( @class_dicts ){
  356.     my $mystring = join ("\n     ",@{ $entries{$class}{$_} });
  357.     $elisp .= "(add-to-list \'debian-$class-only-dictionary-alist\n  \'($mystring))\n";
  358.       }
  359.       $elisp .= "\n";
  360.     }
  361.   }
  362.  
  363.   # Write a list of locales associated to each emacsen name
  364.  
  365.   foreach my $class ("aspell", "hunspell"){
  366.     my $tmp_locales = $class_locales{$class};
  367.     if ( defined $tmp_locales && scalar %$tmp_locales ){
  368.       $elisp .= "\n\n;; An alist that will try to map $class locales to emacsen names";
  369.       $elisp .= "\n\n(setq debian-$class-equivs-alist \'(\n";
  370.       foreach ( sort keys %$tmp_locales ){
  371.     $elisp .= "     (\"$_\" \"$tmp_locales->{$_}\")\n";
  372.       }
  373.       $elisp .= "))\n";
  374.  
  375.       # Obtain here debian-aspell-dictionary, after debian-aspell-equivs-alist
  376.       # is loaded
  377.  
  378.       $elisp .="
  379. ;; Get default value for debian-$class-dictionary. Will be used if
  380. ;; spellchecker is $class and ispell-local-dictionary is not set.
  381. ;; We need to get it here, after debian-$class-equivs-alist is loaded
  382.  
  383. (setq debian-$class-dictionary (debian-ispell-get-$class-default))\n\n";
  384.    } else {
  385.       $elisp .= "\n\n;; No emacsen-$class-equivs entries were found\n";
  386.    }}
  387.  
  388.   open (ELISP, "> $cachedir/$emacsensupport")
  389.       or die "Cannot open emacsen cache file";
  390.   print ELISP generate_comment (";;; ");
  391.   print ELISP $elisp;
  392.   close ELISP;
  393. }
  394.  
  395. # ------------------------------------------------------------------
  396. sub build_jed_support {
  397. # ------------------------------------------------------------------
  398. # Put info from dicts info files into jed-ispell-dicts.sl
  399. # ------------------------------------------------------------------
  400.  
  401.   my @classes = ("aspell","ispell");
  402.   my $slang   = generate_comment ("%%% ");
  403.  
  404.   ## The S-Lang code generated below will be wrapped in preprocessor
  405.   ## ifexists constructs, insuring that the $jedsupport file will
  406.   ## always evaluate correctly.
  407.  
  408.   foreach $class ( @classes ){
  409.     my %class_slang    = ();
  410.     my %class_slang_u8 = ();
  411.     if ( my $dictionaries = loaddb ($class) ){
  412.       foreach $k (sort keys %$dictionaries) {
  413.     my $lang = $dictionaries->{$k};
  414.     next if (exists $lang->{'jed-display'}
  415.          && $lang->{'jed-display'} eq "no");
  416.  
  417.     my $hashname = $lang->{"hash-name"};
  418.     my $additionalchars = exists $lang->{additionalchars} ?
  419.         $lang->{additionalchars} : "";
  420.     my $otherchars = exists $lang->{otherchars} ?
  421.         $lang->{otherchars} : "'";
  422.     my $emacsenname = exists $lang->{"emacsen-name"} ?
  423.         $lang->{"emacsen-name"} : $hashname;
  424.     my $extendedcharmode = exists $lang->{"extended-character-mode"} ?
  425.         $lang->{"extended-character-mode"} : "";
  426.     my $ispellargs = exists $lang->{"ispell-args"} ?
  427.         $lang->{"ispell-args"} : "";
  428.     my $codingsystem = exists $lang->{"coding-system"} ?
  429.         $lang->{"coding-system"} : "l1";
  430.  
  431.     # Strip enclosing [] from $otherchars
  432.     $otherchars =~ s/^\[//;
  433.     $otherchars =~ s/\]$//;
  434.     # Convert chars in octal \xxx representation to the character
  435.     $otherchars =~ s/\\([0-3][0-7][0-7])/chr(oct($1))/ge;
  436.     $additionalchars =~ s/\\([0-3][0-7][0-7])/chr(oct($1))/ge;
  437.  
  438.     $class_slang{$emacsenname} =
  439.         "  $class" . "_add_dictionary (\n"
  440.         . "    \"$emacsenname\",\n"
  441.         . "    \"$hashname\",\n"
  442.         . "    \"$additionalchars\",\n"
  443.         . "    \"$otherchars\",\n"
  444.         . ($class eq "ispell" ? "    \"$extendedcharmode\",\n" : "")
  445.         . "    \"$ispellargs\");";
  446.     if ( $class eq "aspell" ){
  447.       my $converter = Text::Iconv->new ($codingsystem, "utf8");
  448.       my $additionalchars_utf = $converter->convert ($additionalchars);
  449.       my $otherchars_utf = $converter->convert ($otherchars);
  450.       $class_slang_u8{$emacsenname} =
  451.           qq{    aspell_add_dictionary (
  452.       "$emacsenname",
  453.       "$hashname",
  454.       "$additionalchars_utf",
  455.       "$otherchars_utf",
  456.       "$ispellargs");};
  457.     } # if $class ..
  458.       } # foreach $k ..
  459.     } # if loaddb ..
  460.     if ( scalar keys %class_slang ){
  461.       $slang .= "\n\#ifexists $class" . "_add_dictionary\n";
  462.       if ( $class eq "aspell" ){
  463.     $slang .= "  if (_slang_utf8_ok) {\n"
  464.         . join("\n",sort values %class_slang_u8)
  465.         . "\n  } else {\n"
  466.         . join("\n",sort values %class_slang)
  467.         . "\n  }";
  468.       } else {
  469.     $slang .= join("\n",sort values %class_slang);
  470.       }
  471.       $slang .= "\n\#endif\n";
  472.     }
  473.   } # foreach $class
  474.   open (SLANG, "> $cachedir/$jedsupport")
  475.       or die "Cannot open jed cache file";
  476.   print SLANG $slang;
  477.   close SLANG;
  478. }
  479.  
  480. # ------------------------------------------------------------------
  481. sub build_squirrelmail_support {
  482. # ------------------------------------------------------------------
  483. # Build support file for squirrelmail with a list of available
  484. # dictionaries and associated spellchecker calls, in php format.
  485. # ------------------------------------------------------------------
  486.   my @classes      = ("aspell","ispell","hunspell");
  487.   my $php          = "<?php\n";
  488.   my @dictlist     = ();
  489.  
  490.   $php .= generate_comment ("### ");
  491.   $php .= "\$SQSPELL_APP = array (\n";
  492.  
  493.   foreach my $class (@classes) {
  494.     my $dictionaries = loaddb ($class);
  495.     foreach ( keys %$dictionaries ){
  496.       next if m/.*[^a-z]tex[^a-z]/i;            # Discard tex variants
  497.       my $lang = $dictionaries->{$_};
  498.       my $squirrelname;
  499.       if ( defined $lang->{"squirrelmail"} ){
  500.     next if ( lc($lang->{"squirrelmail"}) eq "no" );
  501.     $squirrelname = $lang->{"squirrelmail"};
  502.       } else {
  503.     next unless m/^(.*)\((.+)\)$/;
  504.     $squirrelname = $2;
  505.       }
  506.       my $spellchecker_params =
  507.     &dico_get_spellchecker_params($class,$lang);
  508.       push @dictlist, qq {  '$squirrelname ($class)' => '$class -a $spellchecker_params'};
  509.     }
  510.   }
  511.  
  512.   $php .= join(",\n", sort @dictlist);
  513.   $php .= "\n);\n";
  514.  
  515.   open (PHP, "> $cachedir/$squirrelmailsupport")
  516.       or die "Cannot open SquirrelMail cache file";
  517.   print PHP $php;
  518.   close PHP;
  519. }
  520.  
  521. # Ensure we evaluate to true.
  522. 1;
  523.  
  524. __END__
  525.  
  526. #Local Variables:
  527. #perl-indent-level: 2
  528. #End:
  529.  
  530. =head1 NAME
  531.  
  532. Debian::DictionariesCommon.pm - dictionaries-common library
  533.  
  534. =head1 SYNOPSIS
  535.  
  536.     use Debian::DictionariesCommon q(:all)
  537.     $dictionaries = parseinfo ('/var/lib/dictionaries-common/ispell/iwolof');
  538.     loaddb ('ispell')
  539.     updatedb ('wordlist')
  540.  
  541. =head1 DESCRIPTION
  542.  
  543. Common functions for use from the dictionaries-common system.
  544.  
  545. =head1 CALLING FUNCTIONS
  546.  
  547. =over
  548.  
  549. =item C<dico_checkroot>
  550.  
  551. Check for rootness and fail if not.
  552.  
  553. =item C<build_emacsen_support>
  554.  
  555. Put info from dicts info files into emacsen-ispell-dicts.el
  556.  
  557. =item C<build_jed_support>
  558.  
  559. Put info from dicts info files into jed-ispell-dicts.sl
  560.  
  561. =item C<build_squirrelmail_support>
  562.  
  563. Build support file for squirrelmail with a list of available
  564. dictionaries and associated spellchecker calls, in php format.
  565.  
  566. =item C<$libdir = getlibdir($class)>
  567.  
  568. Return info dir for given class.
  569.  
  570. =item C<$default = dico_getsysdefault($class)>
  571.  
  572. Return system default value for given class.
  573.  
  574. =item C<$libdir = getuserdefault>
  575.  
  576. Return value for user default ispell dictionary.
  577.  
  578. =item C<dico_get_spellchecker_params($class,\%language)>
  579.  
  580. Get right params for $class (currently unused) and $language
  581.  
  582. =item C<\%dictionaries = loaddb($class)>
  583.  
  584. Read class .db file and return a reference to a hash
  585. with its contents.
  586.  
  587. =item C<\%result = parseinfo($file)>
  588.  
  589. Parse given info file and return a reference to a hash with
  590. the relevant data.
  591.  
  592. =item C<setsysdefault($value)>
  593.  
  594. Set value for system default ispell dictionary.
  595.  
  596. =item C<setuserdefault>
  597.  
  598. Set value for user default ispell dictionary, after asking
  599. to select it from the available values.
  600.  
  601. =item C<updatedb($class)>
  602.  
  603. Parse info files for given class and update class .db
  604. file under dictionaries-common cache dir.
  605.  
  606. =back
  607.  
  608. =head1 SEE ALSO
  609.  
  610. Debian dictionaries-common policy.
  611.  
  612. =head1 AUTHORS
  613.  
  614.  Rafael Laboissiere
  615.  Agustin Martin
  616.  
  617. =cut
  618.